package com.cszy.yydqbfq.adapter

import android.content.Context
import android.content.res.ColorStateList
import android.graphics.Color
import android.view.ViewGroup
import android.widget.ImageView
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.cszy.yydqbfq.R

import com.cszy.yydqbfq.bean.IndexGridBean
import com.cszy.yydqbfq.utils.SpUtils
import com.hlyj.http.base.tool.lib_hlyj_base.utils.BaseAppConstans


class indexGridAdapter : BaseQuickAdapter<IndexGridBean, QuickViewHolder>() {

    override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: IndexGridBean?) {
        holder.setText(R.id.tv_title, item?.title)
        holder.setBackgroundResource(R.id.sub_iv, item?.subImg ?: 0)
        holder.itemView.setBackgroundResource(item?.img ?: 0)

    }

    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): QuickViewHolder {
        return QuickViewHolder(R.layout.item_index_grid, parent)
    }
}